<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Using Web Runner</title>
</head>

<body>

<h2>Running generic stories via a web-based interface</h2>

<p>The Web Runner provides a simple web-based interface to running
generic stories. A typical use case is for BAs, QAs or stakeholders to
be able to access the results of story running without needing access to
developer resources, e.g. source control or build systems.</p>

<p>A fully functional example webapp is provided in <a
	href="https://github.com/jbehave/jbehave-web/blob/master/examples/trader-runner">trader
runner example</a>. We'll be using this example to illustrate the use of Web
Runner:</p>

<ul>
	<li><a href="customising-web-runner.html">Customise Web Runner</a></li>
	<li>Deploy webapp to your favourite webapp container</li>
	<li>Open page <b>http://localhost:8080/trader-runner</b> (assuming
	normal port conventions)</li>
</ul>

<h2>Run Story</h2>

<p>The Run Story page allows the user to run synchronously any textual story, waiting for it to complete, and
displaying the result in the same page.</p>

<ul>
	<li>From Menu, click on <b>Run Story</b>, which will take you to a
	page where you can enter your textual story.</li>
	<li>Input textual story in textarea (e.g you can cut &amp; paste
	the sample scenarios found in the <a
		href="https://github.com/jbehave/jbehave-web/blob/master/examples/trader-runner/src/main/resources/trader.story">trader.story</a>) 
        and click on <b>Run</b> button.</li>
	<li>Optionally, a meta filter can be specified.</li>
	<li>Upon execution, the output of the story is shown below. By
	default the same output is shown as the one you would see when running
	JBehave via a command-line interface. This includes any details of
	failed and pending steps. If any failures occur, the user has the stack
	trace in an expandable section below.</li>
</ul>

<h2>Submit Story</h2>

<p>The Submit Story page allows the user to run asynchronously any textual story.  The result can be then viewed (once completed) in the View Story page.
</p>

<ul>
    <li>From Menu, click on <b>Submit Story</b>, which will take you to a
    page where you can enter your textual story.</li>
    <li>Input textual story in textarea (e.g you can cut &amp; paste
    the sample scenarios found in the <a
        href="https://github.com/jbehave/jbehave-web/blob/master/examples/trader-runner/src/main/resources/trader.story">trader.story</a>) 
        and click on <b>Submit</b> button.</li>
    <li>Optionally, a meta filter can be specified.</li>
    <li>Upon execution, a story path (a timestamped id) is generated and an clickable link is provided to the View Story page.</li>
</ul>

<h2>View Story</h2>

<p>The View Story page allows the user to view all the stories run (synchronously or asynchronously) and view the output as text.
</p>

<ul>
    <li>From Menu, click on <b>View Story</b>, which will take you to a
    page where all the stories run as displayed.</li>
    <li>The columns of the table are sortable by clicking on the header links.</li>
    <li>Each story output can be viewed as text by clicking on the corresponding 'txt' link.</li>
</ul>

<h2>Explore Steps</h2>

<p>The Find Steps page allows the user to explore available steps pattern by auto-completion and to display the patterns 
in a drop-down list.</p>

<ul>
    <li>From Menu, click on <b>Find Steps</b>, which will take you to
    a page where you have an <b>Explore</b> panel.</li>
    <li>Start typing in the input field (e.g you can type "Given" to display all the Given type step patterns).</li>
    <li>The auto-completed list will include any step pattern that matches in part the input text.</li>
</ul>

<h2>Match Steps</h2>

<p>The Find Steps page allows the user to find methods in steps classes that match a given complete textual step and 
to display them.</p>

<ul>
	<li>From Menu, click on <b>Find Steps</b>, which will take you to
	a page where you can enter your complete textual step.</li>
	<li>Input the complete textual step in textarea (e.g you can cut &amp; paste a
	step from the sample scenarios found in the <a
        href="https://github.com/jbehave/jbehave-web/blob/master/examples/trader-runner/src/main/resources/trader.story">trader.story</a>) 
	   and click on <b>Find</b> button.</li>
	<li>A blank input will simply show all the methods that are configured.</li>
	<li>Upon execution, the steps found are shown below. By default,
	only the patterns are shown, but you can choose to also display
	associated methods.</li>
	<li>The final section shows the steps instances that were
	configured and were used to find the steps.</li>
</ul>

<h2>Data Files</h2>

<p>The Data Files page allows the user to upload and view any data
file that may be used during the execution of the story. Data files can
be either single text files or zip archives. If archives, these are
automatically unzipped when upload to the server.</p>

<ul>
	<li>From Menu, click on <b>Data Files</b>, which will take you to
	a page where you can view the files already uploaded to the upload
	directory (defaults to "/tmp/upload" but is configurable via the <a
		href="javadoc/web-runner/org/jbehave/web/runner/wicket/WebRunnerApplication.html#uploadDirectory()">WebRunnerApplication#uploadDirectory()</a>).</li>
	<li>Use the <b>Browse</b> and <b>Upload</b> buttons to upload any
	file to the upload directory.</li>
	<li>Use the <b>Show Content</b> and <b>Hide Content</b> buttons to
	toggle display of uploaded file content.</li>
	<li>Click on <b>View</b> link next to the files to view their
	content.</li>
	<li>Use the <b>Delete</b> button to delete any selected files.</li>
</ul>

<h2>Wiki</h2>

<p>The Wiki page allows the user to view the resources contained on a Wiki.  The root URI of
the Wiki is configured in the <a
		href="javadoc/web-runner/org/jbehave/web/runner/wicket/WebRunnerApplication.html#wikiConfiguration()">WebRunnerApplication#wikiConfiguration()</a>.
</p>
<p>
The resources are displayed in a tree view representing the hierarchical structure of the 
Wiki resources.  The 'Update' button allows to refresh and update the view, if the Wiki content has changed.
The tree view can collapsed and expanded node by node or all at once using the links provided.  
</p>
<p>
Each wiki resource in the tree is selectable.  Once selected it can be:
<ul>
	<li>Edited:  the user is forwarded to the page on the wiki</li>
	<li>Viewed:  the user is shown the content of the page in the Web Runner</li>
	<li>Run:  the content of the page is executed as a story</li>
</ul>
</p>
<p><b>NOTE:</b> At this stage the Web Runner has no way of distinguishing which of the wiki resources 
are real stories and which are container pages.  For the latter, it will treat them as stories without
real executable content, i.e. without scenarios.   Going forward, some criteria can be introduced to
establish the nature of the resource by inspecting its content, e.g. one can look for the scenario keyword.
</p>

</body>
</html>